package com.backstage.utils;

import org.apache.commons.collections.map.HashedMap;

import java.util.List;
import java.util.Map;

public class PageBean<T> {
    private List<T> list;

    private int current_page;
    private int page_size;

    private int next_page;
    private int prev_page;

    private long total_count;
    private long total_page;


    public void setPageBeanObj(int current_page, int page_size, int next_page, int prev_page, long total_count, long total_page){
        this.current_page = current_page;
        this.page_size = page_size;
        this.next_page = next_page;
        this.prev_page = prev_page;
        this.total_count = total_count;
        this.total_page = total_page;
    }

    public Map<String,Object> getPageBeanObj(){
         Map<String,Object> res = new HashedMap();
        res.put("current_page",current_page);
        res.put("page_size",page_size);
        res.put("next_page",next_page);
        res.put("prev_page",prev_page);
        res.put("total_count",total_count);
        res.put("total_page",total_page);
        return res;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "list=" + list +
                ", current_page=" + current_page +
                ", page_size=" + page_size +
                ", next_page=" + next_page +
                ", prev_page=" + prev_page +
                ", total_count=" + total_count +
                ", total_page=" + total_page +
                '}';
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getCurrent_page() {
        return current_page;
    }

    public void setCurrent_page(int current_page) {
        this.current_page = current_page;
    }

    public int getPage_size() {
        return page_size;
    }

    public void setPage_size(int page_size) {
        this.page_size = page_size;
    }

    public int getNext_page() {
        return next_page;
    }

    public void setNext_page(int next_page) {
        this.next_page = next_page;
    }

    public int getPrev_page() {
        return prev_page;
    }

    public void setPrev_page(int prev_page) {
        this.prev_page = prev_page;
    }

    public long getTotal_count() {
        return total_count;
    }

    public void setTotal_count(long total_count) {
        this.total_count = total_count;
    }

    public long getTotal_page() {
        return total_page;
    }

    public void setTotal_page(long total_page) {
        this.total_page = total_page;
    }
}

